<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix='sec' uri='http://www.springframework.org/security/tags'%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/boot.js"></script>
<style type="text/css">
	.item{
		width: 135px;
		display: inline-block;
		margin-left: 5px;
	}
</style>
</head>
<body style="border: 0px; margin: 0px; padding: 0px;width: 100%;height: 100%">
	<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
	    <table style="width:100%;">
	        <tr>
	        	 <td style="width:30%;">
	        	   <span class="item">下单时间（开始时间）：</span>
                   <input format="yyyy-MM-dd H:mm:ss" emptyText="请选择..." id="start_time" class="mini-datepicker" timeFormat="H:mm:ss" showTime="true" style="width: 160px" allowInput="false"/>
                 </td>
                 <td style="width:30%;">  
                   <span class="item">下单时间（结束时间）：</span>                     
                   <input id="end_time" format="yyyy-MM-dd H:mm:ss" emptyText="请选择..." class="mini-datepicker" timeFormat="H:mm:ss"  showTime="true" style="width: 160px" allowInput="false"/>   
	             </td>
	             <td style="display: inline-block;"> 
                   <a class="mini-button" iconCls="icon-search" onclick="search()">查询</a>
                 </td>
	        </tr>
	    </table>           
	</div>
	<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
	    <table style="width:100%;">
	        <tr>
	            <td style="width:100%;">
	            	<sec:authorize url='/province_orders_sta_expots.do'>
                    <a class="mini-button" iconCls="icon-ok" onclick="exportAllData()">导出所有</a>
                    </sec:authorize>
                    <span style="color: #f00;">（注：数据不包含正在输入单、无效单、取消单）</span>
            	</td>
	        </tr>
	    </table>           
	</div>
	<div class="mini-fit" >
	<div id="datagrid1" class="mini-datagrid " idField="id" pageSize="20" url="province_orders_sta_view.do" style="width:100%;height:100%;" multiSelect="true">
		<div property="columns">
			<div field="provinceName" width="100" headerAlign="center" align="center">省份</div>
			<div field="ordersCount" width="100" headerAlign="center" align="center">总计订单数</div>
			<div field="tcommodityMoney" width="100" headerAlign="center" align="center">总计金额</div>
			<div field="postCount" width="90" headerAlign="center" align="center" >妥投单数</div>
			<div field="postMoney" width="90" headerAlign="center" align="center">妥投金额</div>
			<div field="backCount" width="90" headerAlign="center" align="center">退回单数</div>
			<div field="backMoney" width="90" headerAlign="center" align="center">退回金额</div>
			<div field="feedbackCount" width="90" headerAlign="center" align="center">无反馈单数</div>
			<div field="feedbackMoney" width="90" headerAlign="center" align="center">无反馈金额</div>
		</div>
	</div>
	</div>

<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid1");

var startTime = mini.get("start_time");
var endTime = mini.get("end_time");

grid.load();

function search() {
	grid.load({startTime: startTime.getFormValue(), endTime: endTime.getFormValue()});
}

function onKeyEnter(e) {
    search();
}

//导出全部
function exportAllData(){
	var startTime = mini.get("start_time").getFormValue();
	var endTime = mini.get("end_time").getFormValue();
	window.location.href="province_orders_sta_expots.do?stime="+startTime+"&etime="+endTime; 
}
</script>
</body>
</html>